Now we will compare the platforms
to understand their relative strengths. After we've talked about those platforms,
the question remains: where should I run my applications? And the answer is still "it depends". The first question you might ask is "how
much infrastructure control do I need?" If you want to lift-and-shift
existing legacy systems to the cloud, or if you have specific
licensing requirements that depend on the hardware,
you might need to use Compute Engine. If you can run containers and have hybrid systems on multiple clouds
or data centers, or if you have applications
that are not HTTP-based, Google Kubernetes
Engine might be the right choice. If you want to run stateless containers
but not manage the infrastructure at all, Cloud Run
might be the best choice. And if you just need to write event-driven
functions to connect cloud services, Cloud Functions is probably
the correct choice. Gaining more control
over the infrastructure requires more operational effort. When you create a Compute
Engine virtual machine, you control the updates
for the operating system and software. With GKE, Google manages
the virtual machine nodes for your cluster, but
you still manage the size of the cluster and decide how to scale each application
within the cluster. Cloud Run and Cloud
Functions are serverless. For those platforms,
you just need to deploy your application and Google manages
the infrastructure and auto scaling. Another question is "how are my teams
structured?" If your teams are mostly developer-focused, Cloud Run and Cloud
Functions are probably best for you. If you have both developers
and operations teams, you might still use Cloud
Run and Cloud Functions when appropriate. You might also decide to use
Google Kubernetes Engine to integrate with your hybrid systems
and have more control over your workloads. GKE also lets you use GPUs, TPUs, and non-HTTP network protocols, which are not available
for Cloud Run and Cloud Functions. If you are modernizing your applications
over time, you might need to manage Compute Engine VMs that have been migrated
from on-premises data centers. Your operations team
must be able to manage the health and security of these virtual machines. Pricing for the platforms is different,
which may affect your choice as well. Compute Engine and Google Kubernetes Engine charges are based on
the usage of dedicated VMs. The charges are predictable,
and these platforms can be ideal when you require consistent capacity
for your applications. Cloud Run and Cloud
Functions are pay per use, which can result in significant savings, especially when your traffic patterns
are inconsistent. This sketch note, titled "Where
should I run my stuff,"provides a visualization of the relative strengths
of the platforms. In general, as you move toward the left, you have more control
over your application and infrastructure, but managing that infrastructure requires
more operational cost and effort. The two platforms on
the right are serverless, which requires much less
operational burden and lets you focus on the application
instead of the infrastructure. Different applications
have different requirements and you can choose the platform
that best meets your requirements. You don't need to standardize
on a single platform, even within a single application. Larger applications may benefit
from using multiple platforms that allow them to solve each problem
with the correct tool. Applications that don't have unusual
infrastructure requirements can typically be run
on multiple platforms. If you use the Cloud
Client Libraries in your code, moving code from one platform to another
is usually easy. Containerized applications
can be run on both Cloud Run and Google Kubernetes Engine. When you don't want to manage the containers, you can deploy your code
to Cloud Functions or deploy to Google Kubernetes Engine or Cloud Run by using buildpacks. The ease of running the same application
on different platforms means that you don't have to worry
too much about your decision. For example, you might initially decide
to run your application on Cloud Run, with Google
managing the infrastructure and scaling. Later, when your application starts
getting more traffic, you might decide to run the same application on Google
Kubernetes Engine for more control. There are similar sketch notes for many
products and products comparisons, and you may find them helpful
for understanding the benefits and usage of different
Google Cloud products. You can see more sketch notes
at thecloudgirl.dev. We've talked about four platforms,
but haven't yet talked about App Engine. App Engine is a fully managed
serverless compute option used to build and deploy low latency, highly scalable
web applications. App engine supports
two environments: standard and flexible. The App Engine standard
environment runs your code in a sandbox, and doesn't require you
to build containers. However, your applications must be written
with specific versions of supported languages. The standard environment responds
well to spikes in traffic by scaling up within seconds and scaling down to zero
after 15 minutes of inactivity. You pay based on the computing instances
that are running your application, but do not need to manage those instances. You pay nothing when your application
scales down to zero. The standard environment
is a reasonable choice for non-containerized applications
with spikes in traffic. The App Engine flexible environment
requires you to create a container for your application,
but you gain flexibility by doing so. Your code can be written
using any languages and libraries. The flexible environment is better
for applications that have sustained traffic,
because it scales up and down much slower than the standard environment does,
and cannot scale to zero. Your application will always need to run
in at least one instance. Like the standard environment, you pay for all computing instances
that are used by the flexible environment. Cloud Run provides many of the best
features of both App Engine environments. Cloud run applications
are required to run in containers. If you do not need custom
containers, buildpacks can automatically create
the containers for you. Cloud Run can scale up and down almost
immediately in response to traffic spikes. Unlike App Engine,
you only pay for Cloud Run when you are processing requests, rounded up
to the nearest 10th of a second. This pricing model
can result in significant cost savings for your application. App engine is fully supported and it works
well for creating web applications and web APIs, but cloud run is often
a better choice for those use cases. Returning to the question "Where
should I run my applications?", the best answer is
that you should run each application on the platform that best fits
its requirements. Most applications written with the Cloud
Client Libraries can be easily moved from platform to platform,
so you can change your decision later. If you do not have complex
infrastructure requirements, start with a serverless platform
that lets you focus on the application
instead of the infrastructure. If you later want more control
over the infrastructure, you can move your application to a platform
that requires more operational effort but provides the needed
control or flexibility.